import request from '@/utils/request'

// 获取所有讲师
export const getAllTeacher = () => {
  return request({
    url: '/eduservice/teacher/list'
  })
}

// 查询讲师列表
export const getTeacherList = (page, limit, teacherQuery) => {
  return request({
    url: `/eduservice/teacher/list/condition/${page}/${limit}`,
    method: 'POST',
    data: teacherQuery
  })
}

// 根据id删除讲师
export const deleteTeacher = id => {
  return request({
    url: `/eduservice/teacher/${id}`,
    method: 'DELETE'
  })
}

// 新增讲师
export const addTeacher = teacher => {
  return request({
    url: `/eduservice/teacher`,
    method: 'POST',
    data: teacher
  })
}

// 根据id查询讲师
export const findTeacher = id => {
  return request({
    url: `/eduservice/teacher/${id}`,
    method: 'GET'
  })
}

// 修改讲师
export const updateTeacher = (id, teacher) => {
  return request({
    url: `/eduservice/teacher/${id}`,
    method: 'POST',
    data: teacher
  })
}
